package woshiheima6;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
//conlection集合
public class Conlection {
    public static void main(String[] args) {
        Collection<String> c = new ArrayList<String>();
        c.add("hello");
        c.add("world");
        c.add("java");
       // System.out.println(c);
        //迭代器
        Iterator<String> it=c.iterator();
        while (it.hasNext()){   //判断是否为空
            String s = it.next(); //将结果传给你一个变量以便操作数据
            System.out.println(s);//打印结果
        }
        //list迭代器


    }
}
